/*
 * UpdateResources.java
 *
 * Created on May 5, 2009, 6:21 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package im.resources;

import im.node.MobileNode;
import im.node.ResourceStatus;
import jade.core.behaviours.CyclicBehaviour;

/**
 *
 * @author bluejack
 */
public class UpdateResources extends CyclicBehaviour {
    MobileNode mn = null;
    
    CPUMonitor cpu = new CPUMonitor();

    public UpdateResources(MobileNode mn) {
        this.mn = mn;
    }
    public void action() {
        ResourceStatus status = mn.getStatus();
        
        status.setStatus(cpu.check());
        
        mn.setStatus(status);
    }
    
}
